﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

// log4net classes
using log4net;
using log4net.Config;

namespace RVBike
{
    class Logger : Singleton<Logger>
    {
        private static ILog _log = LogManager.GetLogger("RVBIKE");
        public Logger()
        {
            try
            {
                string loggerConfigPath = PathUtility.Instance().ResourcesDir + "logger.xml";
                XmlConfigurator.Configure(new FileInfo(loggerConfigPath));
            }
            catch (Exception e)
            {
                System.Diagnostics.Trace.WriteLine(e.Message);
            }
        }

        ~Logger()
        {
        }

        public void Debug(object o)
        {
            _log.Debug(o);
        }

        public void Info(object o)
        {
            _log.Info(o);
        }

        public void Warn(object o)
        {
            _log.Warn(o);
        }

        public void Error(object o)
        {
            _log.Error(o);
        }

        public void Fatal(object o)
        {
            _log.Fatal(o);
        }
    }
}
